<?php

/**
 * @category   Auguria
 * @package    Auguria_Sponsorship
 * @author     Auguria
 * @license    http://opensource.org/licenses/osl-3.0.php  Open Software License (OSL 3.0)
 */
class Zhishidi_Question_Block_Adminhtml_Question extends Mage_Adminhtml_Block_Widget_Grid_Container {

    public function __construct() {
        $this->_blockGroup = 'zhishidi_question';
        $this->_controller = 'adminhtml_question';

        $this->_headerText = Mage::helper('zhishidi_question')->__('Manage Question');
        parent::__construct();
        $this->removeButton('add');
    }

    protected function _prepareLayout() {
        if (!Mage::app()->isSingleStoreMode()) {
            $this->setChild('store_switcher',
                            $this->getLayout()->createBlock('adminhtml/store_switcher')
                            ->setUseConfirm(false)
                            ->setSwitchUrl($this->getUrl('*/*/*', array('store' => null)))
            );
        }
        return parent::_prepareLayout();
    }

    public function getGridHtml() {
        return $this->getStoreSwitcherHtml() . $this->getChildHtml('grid');
    }

    public function getStoreSwitcherHtml() {
        return $this->getChildHtml('store_switcher');
    }

}